package com.lwei.tallybook.client;

import cn.hutool.cron.CronUtil;
import lombok.extern.log4j.Log4j2;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.ComponentScan;

/**
 * 启动类
 * @author sks.lwei
 */
@Log4j2
@SpringBootApplication
@ComponentScan(basePackages = {"com.lwei.tallybook.service", "com.lwei.tallybook.client"})
public class TallyBookApplication {

    public static void main(String[] args) {
        SpringApplication.run(TallyBookApplication.class, args);
        startCornJobs();
    }

    private static void startCornJobs(){
        CronUtil.setCronSetting("cron/cron.setting");
        CronUtil.start();
        log.info("定时任务启动成功...");
    }
}
